package com.geekbang.boot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author nhsoft.lul
 */
@Configuration
public class WorkAutoConfiguration {
    @Bean
    public Student student(){
        Student student = new Student();
        student.setId(1);
        student.setName("lul");
        return student;
    }

    @Bean
    @Autowired
    public School school(Student student){
        School school = new School();
        school.setStudent(student);
        return school;
    }
}
